#include <stdio.h>
#include "TestBase.hpp"
#include "TestGeneric.hpp"
#include "TestString.hpp"
#include "TestList.hpp"
#include "TestSet.hpp"
#include "TestHash.hpp"
#include "TestZset.hpp"
#include "TestConcur.hpp"

#ifdef _WIN32
#	pragma comment(lib, "ws2_32.lib")
#	ifdef _WIN64
#		ifdef _DEBUG
#			pragma comment(lib, "lib/windows/64/debug/hiredis.lib")
#		else
#			pragma comment(lib, "lib/windows/64/release/hiredis.lib")
#		endif
#	else
#		ifdef _DEBUG
#			pragma comment(lib, "lib/windows/32/debug/hiredis.lib")
#		else
#			pragma comment(lib, "lib/windows/32/release/hiredis.lib")
#		endif
#	endif
#endif

using namespace std;

#define TEST_SENTINEL 1

int main(int argc, char **argv)
{
#if TEST_SENTINEL
	vector<pair<string, int>> ips{ {"127.0.0.1", 26379}, {"127.0.0.1", 263810}, {"127.0.0.1", 26381} };
	string masterName = "my_sentinel";
	int nTimeout = 10;

	CRedisClient client;
	if (!client.InitializeBySentinel(masterName, ips, nTimeout)) {
		cout << "connect failed!" << endl;
	}
	else {
		cout << "connect succ!" << endl;
	}
	return 0;
#endif

    std::string strHost = "10.10.252.15";
    //std::string strHost = "127.0.0.1";

    while (1)
    {
        CTestBase testBase;
        if (!testBase.StartTest(strHost))
            break;

        //CTestGeneric testKeys;
        //if (!testKeys.StartTest(strHost))
        //    break;

        CTestString testStr;
        if (!testStr.StartTest(strHost))
            break;

        //CTestList testList;
        //if (!testList.StartTest(strHost))
        //    break;

        //CTestSet testSet;
        //if (!testSet.StartTest(strHost))
        //    break;

        //CTestHash testHash;
        //if (!testHash.StartTest(strHost))
        //    break;

        CTestZset testZset;
        if (!testZset.StartTest(strHost))
            break;

        //CTestConcur testConcur;
        //if (!testConcur.StartTest(strHost))
        //    break;

        break;
    }
    return 0;
}

